Grokking System Design Fundamentals
Rate this course
Ask Author
Contribute
Back to course home

50% completed

Vote For New Content
System Design Fundamentals
Introduction to System Design
Load Balancing
Introduction to Load Balancing
Load Balancing Algorithms
Uses of Load Balancing
Load Balancer Types
Stateless vs. Stateful Load Balancing
High Availability and Fault Tolerance
Scalability and Performance
Challenges of Load Balancers
API Gateway
Introduction to API Gateway
Usage of API gateway
Advantages and disadvantages of using API gateway
Key Characteristics of Distributed Systems
Scalability
Availability
Latency and Performance
Concurrency and Coordination
Monitoring and Observability
Resilience and Error Handling
Fault Tolerance vs. High Availability
Network Essentials
HTTP vs. HTTPS
TCP vs. UDP
HTTP: 1.0 vs. 1.1 vs 2.0 vs. 3.0
URL vs. URI vs. URN
Domain Name System (DNS)
Introduction to DNS
DNS Resolution Process
DNS Load Balancing and High Availability
Caching
Introduction to Caching
Why is Caching Important?
Types of Caching
Cache Replacement Policies
Cache Invalidation
Cache Read Strategies
Cache Coherence and Consistency Models
Caching Challenges
Cache Performance Metrics
CDN
What is CDN?
Origin Server vs. Edge Server
CDN Architecture
Push CDN vs. Pull CDN
Data Partitioning
Introduction to Data Partitioning
Partitioning Methods
Data Sharding Techniques
Benefits of Data Partitioning
Common Problems Associated with Data Partitioning
Proxies
What is a Proxy Server?
Uses of Proxies
VPN vs. Proxy Server
Redundancy and Replication
What is Redundancy?
What is Replication?
Replication Methods
Data Backup vs. Disaster Recovery
CAP & PACELC Theorems
Introduction to CAP Theorem
Components of CAP Theorem
Trade-offs in CAP Theorem
Examples of CAP Theorem in Practice
Beyond CAP Theorem
System Design Trade-offs in Interviews
Introduction to Databases
SQL Databases
NoSQL Databases
SQL vs. NoSQL
ACID vs BASE Properties
Real-World Examples and Case Studies
SQL Normalization and Denormalization
In-Memory Database vs. On-Disk Database
Data Replication vs. Data Mirroring
Database Federation
What are Indexes?
Types of Indexes
Introduction to Bloom Filters
Benefits & Limitations of Bloom Filters
Variants and Extensions of Bloom Filters
Applications of Bloom Filters
Difference Between Long-Polling, WebSockets, and Server-Sent Events
What is Quorum?
What is Heartbeat?
What is Checksum?
Uses of Checksum
What is Leader and Follower Pattern?
What is Security and Privacy?
What is Authentication?
What is Authorization?
Authentication vs. Authorization
OAuth vs. JWT for Authentication
What is Encryption?
What are DDoS Attacks?
Introduction to Messaging System
Introduction to Kafka
Messaging patterns
Popular Messaging Queue Systems
RabbitMQ vs. Kafka vs. ActiveMQ
Scalability and Performance
What is a Distributed File System?
Architecture of a Distributed File System
Key Components of a DFS
Batch Processing vs. Stream Processing
XML vs. JSON
Synchronous vs. Asynchronous Communication
Push vs. Pull Notification Systems
Microservices vs. Serverless Architecture
Message Queues vs. Service Bus
Stateful vs. Stateless Architecture
Event-Driven vs. Polling Architecture
Quiz
Components of CAP Theorem

Now that we have defined Consistency, Availability, and Partition Tolerance, let's dive deeper into what each of these means in practice for distributed systems, and why they matter.

Consistency in Distributed Systems

Under CAP, consistency means strong consistency across the distributed system. Whenever data is written to one node, that data is immediately (and synchronously) replicated to all nodes before the write is considered successful. This guarantees that any client, reading from any replica, will get the latest data. For example, if you update your profile picture on a social network, a strongly consistent system would ensure that anyone who views your profile (from any server location) sees the new picture immediately after you saved it.

It’s important to note that this is different from the “C” in ACID. In ACID database terms, consistency means the database constraints are preserved after a transaction. In CAP, consistency specifically means atomic/linearizable consistency across replicas – i.e., no two nodes should ever disagree on the current state of the data. Strong consistency simplifies development (you don’t have to worry about stale reads), but it often comes at the cost of speed or availability, especially if nodes are far apart.

There are weaker forms of consistency (like eventual consistency) where all nodes will eventually have the same data, but not instantly. Those are typically what an “AP” system offers – we’ll discuss that shortly. For CAP, think of consistency as the strictest form: every read reflects the most recent write.

Understanding Availability

Availability in CAP doesn’t just mean the system is up; it specifically means every request gets a response even during failures. No matter which node you contact, if it hasn’t crashed, it will respond within a reasonable time. An available system never resorts to saying “sorry, I can’t serve your request right now” due to a node or network failure.

In practical terms, this often means there are multiple redundant nodes, so if one goes down or can’t be reached, another can serve the request. However, an available system might serve stale data if it has to, rather than refuse to answer. The key is that the system remains operational continuously. For example, DNS (the domain name system) is highly available – if one nameserver is down, you’ll query another. You might occasionally get an outdated DNS entry due to propagation delays, but you will get something back (DNS is an example of an AP system, which favors availability over strict consistency).

In summary, an available system avoids downtime. It prioritizes giving a response over always giving the up-to-the-second correct response. This property is crucial for user-facing services where even a brief outage is unacceptable.

Why Partition Tolerance is Necessary

Partition tolerance is arguably the least negotiable of the three in distributed systems. It means the system can keep working even if network links between nodes fail or some nodes crash. In a distributed system spread across machines or data centers, you will encounter situations where nodes can’t talk to each other (packets get dropped, switches fail, data centers catch fire, etc.). Partition tolerance is the property that the system as a whole survives these events.

For example, imagine a system with nodes in New York and London. If the transatlantic link goes down (a network partition), a partition-tolerant design would allow each side to continue operating (perhaps serving local reads/writes) rather than completely locking up. Without partition tolerance, a network blip could bring your entire service down.

Practically, almost all modern distributed systems require P. If you give up partition tolerance (i.e., choose CA in CAP terms), it means your system is not built to handle network failures between nodes. The only realistic way to be “CA” is to have all components so tightly coupled (or even running on one node) that a partition can’t happen. For instance, a single-instance database on one server can be consistent and available (until that server crashes, of course) – this is a CA scenario but not a distributed system by CAP’s definition. In distributed scenarios, you don’t really get to choose P or not; you must tolerate partitions, so the real-world choice is between C and A when P occurs.

Introduction to CAP Theorem
Trade-offs in CAP Theorem
Mark as Completed

On this page

Consistency in Distributed Systems

Understanding Availability

Why Partition Tolerance is Necessary